/**
 *
 * buttons
 *
 */

function LinkButton({ children, type = "primary", ...restProps }) {
  let typeClass = "text-white bg-[#8C61FF] hover:bg-[#7950E8]";
  switch (type) {
    case "white":
      typeClass = "text-[#795DEC] bg-white hover:bg-[#F6F6F6]";
      break;
  }

  return (
    <a
      className={`inline-block w-full sm:w-fit px-10 py-2.5 ${typeClass} text-base text-center font-bold rounded`}
      href="https://tange-ai.feishu.cn/wiki/wikcnFiXkphfdRu71SKqpFOW9eb"
      target="dev-doc"
      {...restProps}
    >
      {children}
    </a>
  );
}

function ContactSalesButton({ ...restProps }) {
  return (
    <LinkButton
      href="https://tange-ai.feishu.cn/share/base/form/shrcnj1il40PxS8c2ADQN0fygmc"
      target="contact-us"
      {...restProps}
    >
      联系销售
    </LinkButton>
  );
}

function DevDocButton({ ...restProps }) {
  return (
    <button className="w-full sm:w-fit px-10 py-2.5 text-white font-bold text-base bg-[#8C61FF] rounded">
      <a href="https://tange-ai.feishu.cn/wiki/wikcnFiXkphfdRu71SKqpFOW9eb" target="dev-doc">
        开发者文档
      </a>
    </button>
  );
}

export { LinkButton, ContactSalesButton };
